package com.hs.hlw.credit.system.common.enumeration;

import java.util.HashMap;
import java.util.Map;

/**
 * DataBaseType
 * @author zhb
 * @date 2018/10/25
 */
public enum DataBaseType {
    TYPE_1((short) 1, "MySql"),
    TYPE_2((short) 2, "DM"),
    TYPE_3((short) 3, "Oracle"),
    TYPE_4((short) 4, "PostgreSQL"),
    TYPE_5((short) 5, "Sybase"),
    TYPE_6((short) 6, "SqlServer");

    public Short code;
    public String value;

    DataBaseType(Short code, String value) {
        this.code = code;
        this.value = value;
    }

    public static DataBaseType getDataBaseTypeByCode(Short code){
        for (DataBaseType enu : DataBaseType.values()) {
            if (enu.code.equals(code)) {
                return enu;
            }
        }
        return null;
    }

    public static boolean contains(Short code){
        for (DataBaseType enu : DataBaseType.values()) {
            if (enu.code.equals(code)) {
                return true;
            }
        }
        return false;
    }
}